<?php
require_once("../Datos/Selector.php");
require_once("../Datos/SubConsulta.php");
require_once("../Datos/Tablas/Tbl_ec_stock_venta.php");
require_once("../Datos/Tablas/Tbl_ec_stock.php");

class Sel_Sv_Stock extends Selector{

	function Sel_Sv_Stock(&$conexion){
		$this->Selector($conexion);

		$this->Nombre = "Sv_Stock";
		$this->estTablaBase(new Tbl_ec_stock_venta($conexion, ''));

        $relacionada = new Tbl_ec_stock($conexion, 'Stock');
		$this->agregarTablaRelacionada($relacionada, 'INNER JOIN');
		$this->agregarCampoJunta($this->tablaBase->obtCampo('sv_stock'), $this->obtCampoRelacionado('Stock', 'stock_id'), '=');
		
		$campo = $this->obtCampoRelacionado('Stock', 'stock_id');
		$this->agregarCampoVisible($campo);
		
		$campo = $this->obtCampoRelacionado('Stock', 'stock_articulo');
		$this->agregarCampoVisible($campo);
		
		$campo = $this->obtCampoRelacionado('Stock', 'stock_proveedor');
		$this->agregarCampoVisible($campo);
		
		$campo = $this->obtCampoRelacionado('Stock', 'stock_costo');
		$this->agregarCampoVisible($campo);
		
		$campo = $this->obtCampoRelacionado('Stock', 'stock_fecha_compra');
		$this->agregarCampoVisible($campo);
				
		$campo = $this->tablaBase->obtCampo('sv_venta');
		$this->agregarCampoVisible($campo);	

		$this->GenerarConsulta();
		}
}
?>